﻿@model Proggy.Web.Cms.Core.ViewModels.ConfigureDragAndDropPartViewModel
@{
        //Html.AddToBackEndContent("~/Areas/ProggyCore/Content/Css/DragAndDropEditorTEST.css", BackEndContentType.Stylesheet);
        //Html.RenderBackEndContentInLightboxPartial();   
}
<h3 class="proggy-lb-title">
    Configure part</h3>
<div class="proggy-form-div">
    @{
        // get type
        var type = Model.PropertyType.GetType();

        // get attributes
        var attr = (PropertyTypeAttribute)type.GetCustomAttributes(typeof(PropertyTypeAttribute), true).First();

        // get partial
        var partial = attr.View;

        // get instance
        var instance = Model.PropertyType == null ? Activator.CreateInstance(type) : Model.PropertyType;

        // render
        using (Html.BeginRouteForm("", new { action = "Configure", controller = "DragAndDrop", area = "ProggyCore", part = Request["part"] }, FormMethod.Post, new { @class = "proggy-lb-form-within", id = "dand_configure" }))
        {
           
        <div class="dand-partdata-save">
            <p>
                <input type="submit" value="Update" class="proggy-button-go" />
                <span class="italic red">(You will still need to save)</span></p>
            @*<p class="italic red">
                Note: this will only update the content area you are editing. To make the change
                <span class="strong">permanent</span> you must <span class="strong">click "Save"</span>
                from the page below.</p>*@
        </div> 
            
        @:@Html.Raw(HttpUtility.HtmlDecode(Html.ValidationSummary(false).ToHtmlString()))
        @:@Html.Clear()
         
        
        
        <div class="dand-partdata-header">
            <h4>
                Configure part data</h4>
        </div>
        <div class="dand-partdata">
            @{Html.RenderPartial(partial, Model.PropertyType);}
            @Html.HiddenFor(m => m.PropertyType.PropertyNameStart)
            @Html.Hidden("nodeId", Convert.ToInt32(Request["nodeId"]))
        </div>
        <div class="dand-partdata-header">
            <h4>
                Configure size and position</h4>
        </div>
        <div class="dand-partdata dand-coreprops">
            <p>@Html.LabelFor(m => m.Margin)
                Top @Html.TextBoxFor(m => m.MarginTopInt, new { @class = "proggy-textbox proggy-textbox-number" })
                &nbsp;Right @Html.TextBoxFor(m => m.MarginRightInt, new { @class = "proggy-textbox proggy-textbox-number" })
                &nbsp;Bottom @Html.TextBoxFor(m => m.MarginBottomInt, new { @class = "proggy-textbox proggy-textbox-number" })
                &nbsp;Left @Html.TextBoxFor(m => m.MarginLeftInt, new { @class = "proggy-textbox proggy-textbox-number" })
                &nbsp;&nbsp;@Html.DropDownListFor(m => m.MarginType, Model.TypesSelectList)</p>
            <p>@Html.LabelFor(m => m.WidthInt)
                @Html.TextBoxFor(m => m.WidthInt, new { @class = "proggy-textbox proggy-textbox-number" })
                @Html.DropDownListFor(m => m.WidthType, Model.TypesSelectList)</p>
            <p>@Html.LabelFor(m => m.Float)
                @Html.DropDownListFor(m => m.Float, Model.FloatSelectList)</p>
            <p>@Html.LabelFor(m => m.Clear)
                @Html.DropDownListFor(m => m.Clear, Model.ClearSelectList)</p>
        </div>
        <div class="dand-partdata-save">
            <p>
                <input type="submit" value="Update" class="proggy-button-go" />
                <span class="italic red">(You will still need to save)</span></p>
            @*<p class="italic red">
                Note: this will not save your content. You must click "Save" from the page below."</p>*@
        </div>
        }
    }
</div>
